package com.hong.spring.aop;

import com.hong.spring.aop.config.AnnotationConfig;
import com.hong.spring.aop.service.Animal;
import com.hong.spring.aop.service.Person;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Auther: csh
 * @Date: 2020/7/16 10:47
 * @Description: @DeclareParents 测试
 */
public class DeclareParentsTest {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext  applicationContext = new AnnotationConfigApplicationContext(AnnotationConfig.class);
        Person person = applicationContext.getBean("women",Person.class);
        person.likePerson();
        Animal animal = (Animal)person;
        animal.eat();
    }
}
